import { c as coms } from './index-93a12165.mjs';
import { useSSRContext, defineComponent, withAsyncContext, resolveDirective, mergeProps, unref } from 'vue';
import { _ as _export_sfc, u as useRoute, a as useHead, b as useSeoMeta } from '../server.mjs';
import { u as useServerRequest } from './useServerRequest-5f9c762f.mjs';
import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrRenderStyle, ssrGetDirectiveProps, ssrRenderComponent } from 'vue/server-renderer';
import 'node:http';
import 'node:https';
import '../../nitro/node-server.mjs';
import 'fs';
import 'path';
import 'node:fs';
import 'node:url';
import '@unhead/shared';
import 'vue-router';
import '../../index.mjs';
import 'unhead';
import 'tailwind-merge';
import 'highlight.js';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "[id]",
  __ssrInlineRender: true,
  async setup(__props) {
    var _a, _b, _c;
    let __temp, __restore;
    const serialNo = useRoute().params.id;
    const { data: res } = ([__temp, __restore] = withAsyncContext(() => useServerRequest(
      `article/${serialNo}/detail`,
      {
        method: "POST",
        body: { serialNo }
      }
    )), __temp = await __temp, __restore(), __temp);
    const { data: siteInfo } = ([__temp, __restore] = withAsyncContext(() => useServerRequest("sites/info", {
      method: "POST",
      body: {}
    })), __temp = await __temp, __restore(), __temp);
    useHead({
      link: [
        { rel: "shortcut icon", href: siteInfo.value.result.logoUrl },
        { rel: "apple-touch-icon", href: siteInfo.value.result.logoUrl },
        { ref: "icon", type: "image/x-icon", href: siteInfo.value.result.logoUrl, "data-rh": true }
      ],
      meta: [{ name: "twitter:card", content: "summary_large_image" }]
    });
    const info = (_a = res.value) == null ? void 0 : _a.result;
    useSeoMeta({
      title: (_b = info.value) == null ? void 0 : _b.seo.title,
      description: (_c = info.value) == null ? void 0 : _c.seo.description,
      referrer: "no-referrer"
    });
    return (_ctx, _push, _parent, _attrs) => {
      var _a2;
      const _component_coms = coms;
      const _directive_highlight = resolveDirective("highlight");
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "detail" }, _attrs))} data-v-bac67096><div class="page-body" data-v-bac67096><div class="detail-box" data-v-bac67096><p class="detail-box-title" data-v-bac67096>${ssrInterpolate(unref(info).title)}</p><p class="detail-box-info m-flex-r m-jc-s m-ai-c" data-v-bac67096><span class="m-flex-r m-jc-s m-ai-c" data-v-bac67096>`);
      if (unref(info).author.avatarUrl) {
        _push(`<img${ssrRenderAttr("src", unref(info).author.avatarUrl)} style="${ssrRenderStyle({ "border-radius": "50%", "width": "24px", "height": "24px" })}" alt="" data-v-bac67096>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<span style="${ssrRenderStyle({ "margin-left": "8px" })}" data-v-bac67096>${ssrInterpolate(unref(info).author.nickName)}</span></span><span class="iconfont lishixiao m-margin-right4" style="${ssrRenderStyle({ "font-size": "12px" })}" data-v-bac67096></span>`);
      if (unref(info).updateTime) {
        _push(`<span data-v-bac67096>${ssrInterpolate(unref(info).updateTime)}</span>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<span style="${ssrRenderStyle({ "margin-left": "16px", "font-size": "12px" })}" class="iconfont yueduxiao m-margin-right4" data-v-bac67096></span><span style="${ssrRenderStyle({ "margin-left": "8px" })}" data-v-bac67096>${ssrInterpolate((_a2 = unref(info)) == null ? void 0 : _a2.viewsCount)}</span></p>`);
      if (unref(info)) {
        _push(`<div${ssrRenderAttrs(mergeProps({ class: "markdown-body" }, ssrGetDirectiveProps(_ctx, _directive_highlight)))} data-v-bac67096>${unref(info).content}</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div>`);
      _push(ssrRenderComponent(_component_coms, {
        coms: unref(siteInfo).result.components
      }, null, _parent));
      _push(`</div></div>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/detail/[id].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const _id_ = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bac67096"]]);

export { _id_ as default };
//# sourceMappingURL=_id_-925dca8c.mjs.map
